#include "gtkaccessible.h"
#include "gtkprivate.h"
#include "gtkintl.h"
+#include "gtkrenderprivate.h"
#include <math.h>
GtkColorScale *scale = GTK_COLOR_SCALE (widget);
gint width, height, x_offset, y_offset;
cairo_pattern_t *pattern;
+ GtkStyleContext *context;
create_surface (scale);
gtk_color_scale_get_trough_size (scale,
cairo_save (cr);
cairo_translate (cr, x_offset, y_offset);
- cairo_rectangle (cr, 0, 0, width, height);
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_render_content_path (context, cr, 0, 0, width, height);
pattern = cairo_pattern_create_for_surface (scale->priv->surface);
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL &&
static void
gtk_color_scale_init (GtkColorScale *scale)
{
+ GtkStyleContext *context;
+
scale->priv = gtk_color_scale_get_instance_private (scale);
gtk_widget_add_events (GTK_WIDGET (scale), GDK_TOUCH_MASK);
G_CALLBACK (hold_action), scale);
gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (scale->priv->long_press_gesture),
GTK_PHASE_TARGET);
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (scale));
+ gtk_style_context_add_class (context, "color");
}
static void